<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title>perspective-视差滚动特效</title>
    <!-- <link rel="stylesheet" href="css/base.css" /> -->
    <style>
        .demo {
            perspective: 1px; padding: 0; height: 600px; height: calc(100vh - 300px); overflow: auto;
        }
        .box {
            height: 1280px;
            transform-style: preserve-3d;
            position: relative;
        }
        .smile {
            width: 64px;
            height: 64px;
            margin: -400px 0 0 -400px;
        }
        .smile, .flower, .music, .pdf {
            position: absolute;
            left: 50%;
            top: 50%;
            background: url(http://www.zhangxinxu.com/study/201503/mobile_1_layer2.png) no-repeat;
            transform: translate(-50%,-50%);
        }
        .iphone {
            position: absolute;
            left: 50%;
            transform: translate3D(-50%, -120px, -2px) scale(2);
            transform: translate3D(-50%, 160px, -2px) scale(1)\0;
        }
        .smile {
            width: 64px;
            height: 64px;
            margin: -400px 0 0 -400px;
        }
        .flower {
            width: 268px;
            height: 229px;
            background-position: 0 -56px;
            margin: -320px 0 0 400px;
        }
        .music {
            width: 114px;
            height: 114px;
            background-position: -10px -297px;
            margin: -40px 0 0 -300px;
        }
        .pdf {
            width: 130px;
            height: 120px;
            background-position: -10px -423px;
            margin: 140px 0 0 500px;
        }
    </style>
</head>

<body>
    <div class="demo">
        <div class="box">
            <img src="http://www.zhangxinxu.com/study/201503/mobile_1_iphone.jpg" class="iphone">
            <i class="smile"></i><i class="flower"></i><i class="music"></i><i class="pdf"></i>
        </div>
    </div>
</body>

</html>
